import {createWebHistory,createRouter} from 'vue-router'
import store from "@/store/index";
//进度条
import NProgress from 'nprogress' ;
import 'nprogress/nprogress.css';
const routes = [
  { 
    path: '/', 
    component: ()=>import('@/views/index.vue'),
    children:[
      {
        path: 'admin',
        name: '首页',
        component: () => import('@/views/body.vue')
      },{
        path: 'goods',
        name: '商品管理',
        component: () => import('@/views/goods.vue')
      }
    ]
  },
  { path: '/:pathMatch(.*)', redirect:'/404' },
  { path: '/404', component: ()=>import('@/views/404.vue') },
  { path: '/login', component: ()=>import('@/views/login.vue') },
  
]
const router = createRouter({
  history: createWebHistory(),
  routes,
})
export default router